﻿using System;
using System.Collections.Generic;
using System.Text;

namespace IKEA.FileExchange.Domain.FilePackage
{
    public class FilePackageInformation
    {
        private bool isConfidential = false;
        private string uploadComments = string.Empty;
        private string recipientsRaw = string.Empty;
        private string sendManagementLinkToEmail = string.Empty;

        public bool IsConfidential
        {
            get
            {
                return isConfidential;
            }
            set
            {
                isConfidential = value;
            }
        }

        public string UploadComments
        {
            get
            {
                return uploadComments;
            }
            set
            {
                uploadComments = value;
            }
        }

        public string RecipientsRaw
        {
            get
            {
                return recipientsRaw;
            }
            set
            {
                recipientsRaw = value;
            }
        }


        public string SendManagementLinkToEmail
        {
            get
            {
                return sendManagementLinkToEmail;
            }
            set
            {
                sendManagementLinkToEmail = value;
            }
        }

        public List<string> GetRecipients()
        {
            List<string> result = new List<string>();

            if (!string.IsNullOrEmpty(RecipientsRaw))
            {

                string[] r = RecipientsRaw.Split(';');

                foreach (string rec in r)
                {
                    if (!string.IsNullOrEmpty(rec))
                    {
                        result.Add(rec);
                    }
                }

            }

            return result;
        }
    }
}
